import request from '@/hooks/useRequest'

const apiName: string = process.env.VUE_APP_BASE_API;
enum Api {
    Search = '/search',
    Banner = '/banner',
    SongUrl = '/song/url',
    PlayList = 'playlist/detail',
    HotDetail = '/search/hot/detail',
    TopDetail = '/top/playlist'
}

// 搜索音乐
const searchKeywords = (params: object) => {
    return request({ url: apiName + Api.Search, method: 'GET', params })
}
// banner轮播图
const banner = (params: object) => {
    return request({ url: apiName + Api.Banner, method: 'GET', params })
}
// 获取音乐url
const songUrl = (params: object) => {
    return request({ url: apiName + Api.SongUrl, method: 'GET', params })
}
// 获取歌单详情
const playlist = (params: object) => {
    return request({ url: apiName + Api.PlayList, method: 'GET', params })
}
// 获取热搜列表（详细）
const hotDetail = (params: object) => {
    return request({ url: apiName + Api.HotDetail, method: 'GET', params })
}
// 歌单（网友精选碟）
const topDetail = (params: object) => {
    return request({ url: apiName + Api.TopDetail, method: 'GET', params })
}
export { searchKeywords, banner, songUrl, playlist, hotDetail, topDetail }